package com.atguigu.daijia.coupon.mapper;

import com.atguigu.daijia.model.entity.coupon.CouponInfo;
import com.atguigu.daijia.model.vo.coupon.NoReceiveCouponVo;
import com.atguigu.daijia.model.vo.coupon.NoUseCouponVo;
import com.atguigu.daijia.model.vo.coupon.UsedCouponVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CouponInfoMapper extends BaseMapper<CouponInfo> {

    /**
     * @description: 查询未领取优惠券分页列表
     * @author: xiaoxie
     * @date: 2024/11/2 15:08
     * @param: [pageParam, customerId]
     *
     **/
    IPage<NoReceiveCouponVo> findNoReceivePage(Page<CouponInfo> pageParam, Long customerId);

    /**
     * @description: 查询已领取但未使用优惠券分页列表
     * @author: xiaoxie
     * @date: 2024/11/2 15:26
     * @param: [pageParam, customerId]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.atguigu.daijia.model.vo.coupon.NoUseCouponVo>
     **/
    IPage<NoUseCouponVo> findNoUsePage(Page<CouponInfo> pageParam, Long customerId);

    /**
     * @description: 查询已使用优惠券分页列表
     * @author: xiaoxie
     * @date: 2024/11/2 15:31
     * @param: [pageParam, customerId]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.atguigu.daijia.model.vo.coupon.UsedCouponVo>
     **/
    IPage<UsedCouponVo> findUsedPage(Page<CouponInfo> pageParam, Long customerId);

    /**
     * 更新领取数量
     * */
    int updateReceiveCount(Long couponId);

    /**
     * @description: 获取到未使用的已领取的优惠劵列表
     * @author: xiaoxie
     * @date: 2024/11/2 16:22
     * @param: [customerId]
     * @return: java.util.List<com.atguigu.daijia.model.vo.coupon.NoUseCouponVo>
     **/
    List<NoUseCouponVo> findNoUseList(Long customerId);
}
